Skip to content

Conversation

rafaqz
Copy link
Collaborator

@rafaqz rafaqz commented Aug 31, 2025

This currently fails for String, and will for any other non-isbits type

This PR adds another path for non-isbits types in broadcast that just treats the whole array as one chunk.

Closes #261

@rafaqz rafaqz requested a review from meggart August 31, 2025 08:58
@@ -62,15 +62,20 @@ function common_chunks(s, args...)
all(ar -> isa(eachchunk(ar), GridChunks), chunkedarrays) ||
error("Currently only chunks of type GridChunks can be merged by broadcast")
if isempty(chunkedarrays)
totalsize = sum(sizeof ∘ eltype, args)
return estimate_chunksize(s, totalsize)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function does actually the wrong thing. Can we just call into this method

estimate_chunksize(a::AbstractArray) = estimate_chunksize(size(a), element_size(a))
and have the non-isbits types covered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dont call sizeof on Strings and other types with unknown size
2 participants